#include <jni.h>
#include <string>
#include "android/log.h"

extern "C" {
#include "include/libavutil/avutil.h"
}


#define TAG "JackTag"
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, TAG, __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, TAG, __VA_ARGS__)


extern "C" {
//调用getndk.so中的方法
extern int get();
}

extern "C" JNIEXPORT jstring JNICALL
Java_com_jack_jnikotlintest_MainActivity_stringFromJNI(
        JNIEnv *env,
        jobject /* this */) {
    std::string hello = "Hello from C++";

    jint num = get();

    LOGD("------Native-----, %d , ffmpeg version: %s, license: %s", num, av_version_info(), avutil_license());


    return env->NewStringUTF(hello.c_str());
}
